#define DEBUG DEBUG_PRINT
#include "ffz/debug.h"
#include "ffz/bit-ops.h"
void uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
{
    uint16_t a;
    unsigned int i;
    int f;
    if (addr == NULL)
    {
        PRINTA("(NULL IP addr)");
        return;
    }
    for (i = 0, f = 0; i < sizeof(uip_ipaddr_t); i += 2)
    {
        a = (addr->u8[i] << 8) + addr->u8[i + 1];
        if (a == 0 && f >= 0)
        {
            if (f++ == 0)
            {
                PRINTA("::");
            }
        }
        else
        {
            if (f > 0)
            {
                f = -1;
            }
            else if (i > 0)
            {
                PRINTA(":");
            }
            PRINTA("%x", a);
        }
    }
}

void debug_short_array(uint8_t *data, uint16_t length)
{
    uint16_t i;
    for (i = 0; i < length; i += 2)
    {
        uint16_t a = getUInt16(data + i);
        PRINTF("%u ", a);
    }
    PRINTF("\n");
}